package com.cmfi.service.inter;

import java.io.IOException;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import com.cmfi.domain.ForkliftPlan;
import com.cmfi.domain.PlanWorkOrder;

/**
 * Service Interface for managing {@link ForkliftPlan}.
 */
@Transactional
public interface PlanWorkOrderService {
    /**
     * Save a forkliftPlan.
     *
     * @param forkliftPlan the entity to save.
     * @return the persisted entity.
     */
	PlanWorkOrder save(PlanWorkOrder forkliftPlan) throws Exception;

    /**
	 * Updates a forkliftPlan.
	 *
	 * @param forkliftPlan the entity to update.
	 * @return the persisted entity.
	 */
	PlanWorkOrder update(PlanWorkOrder forkliftPlan, Long id) throws Exception;

	/**
	 * 导入excel
	 * @param file
	 * @return
	 * @throws IOException
	 */
	PlanWorkOrder importExcel(MultipartFile file) throws IOException ;

	/**
	 * Get all the forkliftPlans.
	 * @param pageSize 
	 * @param pageNum 
	 *
	 * @param pageable the pagination information.
	 * @return the list of entities.
	 */
	List<PlanWorkOrder> findByPage(long pageNum, long pageSize) throws Exception;

	/**
	 * Description 通过日期和page查询
	 * @param date 日期
	 * @param itemNum 
	 * @param pageNum 
	 * @param pageNum page num
	 * @param pageSize page size
	 * @return List<ForkliftPlan>
	 */
	List<PlanWorkOrder> findByDateAndPage(String date, long pageNum, long itemNum) throws Exception;

	/**
	 * Description 通过date、status和page查询
	 * 
	 * @param date          日期
	 * @param countByStatus 状态
	 * @param pageNum       page num
	 * @param pageSize      page大小
	 * @return List<ForkliftPlan>
	 */
	List<PlanWorkOrder> findByDateStatusAndPage(String date, String countByStatus, long pageNum, long pageSize)
			throws Exception;

	/**
	 * Returns the number of forkliftPlans available.
	 * 
	 * @return the number of entities in the database.
	 *
	 */
    Long countAll();

    /**
     * Returns the number of forkliftPlans available.
     * @return the number of entities in the database.
     *
     */
    Long countByDate(String date);
    Long countByDateAndStatus(String date,String status);

    /**
     * Get the "id" forkliftPlan.
     *
     * @param id the id of the entity.
     * @return the entity.
     */
    PlanWorkOrder findOne(Long id);

    /**
     * Get the "vinCode" forkliftPlan.
     *
     * @param vinCode the vinCode of the entity.
     * @return the entity.
     */
    PlanWorkOrder findByVinCode(String vinCode);

    /**
     * Delete the "id" forkliftPlan.
     *
     * @param id the id of the entity.
     * @return a Mono to signal the deletion
     */
    void delete(Long id);
	
    //Excel导入工单
	public PlanWorkOrder generateForkliftPlanByRowData(List<String> rowDataList) throws IOException;
	
	/**
     * Save a forkliftPlan from MES system.
     *
     * @param responseBody the String that from MES to save.
     * @return the persisted entity.
     */
	PlanWorkOrder saveFromMES(String responseBody) throws Exception;
}
